#include <REGX52.H>
#include "Delay.h"
#include "DHT22.h"
#include "oled.h"
#include "ONEWIRE.h"

unsigned char ack;
int TempT,TempH;
unsigned char buf[5]={0};
void main()
{
	//Timer0_Init();
	OLED_Init();			//初始化OLED  
	OLED_Clear(); 
	OLED_ShowCHinese(18,0,21);//温
	OLED_ShowCHinese(36,0,17);//度
	OLED_ShowCHinese(18,3,20);//湿
	OLED_ShowCHinese(36,3,17);//度
	Delay(2000);
	
	while(1)
	{
		DHT22_Read_Data(&TempT,&TempH);
		OLED_ShowNum(48,0,TempH/10,3,16);
		OLED_ShowChar(72,0,'.',16);
		OLED_ShowNum(74,0,TempH%10,1,16);
		OLED_ShowNum(48,3,TempT/10,3,16);
		OLED_ShowChar(72,3,'.',16);
		OLED_ShowNum(74,3,TempT%10,1,16);
		Delay(2000);
	}
}
